import request from '@/utils/request'

/**
 * 代理列表
 *
 * @param {any} query
 * @returns 代理列表
 */
export const getAgentList = async (query: any) => {
    return await request({
        url: "/agent/list",
        method: "get",
        params: query,
    });
};

/**
 * 代理管理
 *
 * @param {any} query
 * @returns 代理管理
 */
export const getProxyList = async (query: any) => {
    return await request({
        url: "/user/agentList",
        method: "get",
        params: query,
    });
};

/**
 * 查看团队
 *
 * @param {any} query
 * @returns 查看团队
 */
export const getAgentMember = async (query: any) => {
    return await request({
        url: "/user/agentMember",
        method: "post",
        params: query,
    });
};

/**
 * 设置代理
 *
 * @param {any} query
 * @returns 设置代理
 */
export const setProxyUser = async (query: any) => {
    return await request({
        url: "/user/agent",
        method: "post",
        params: query,
    });
};

/**
 * 封禁账号
 *
 * @param {any} query
 * @returns 封禁账号
 */
export const banUser = async (query: any) => {
    return await request({
        url: "/user/banUser",
        method: "post",
        params: query,
    });
};

/**
 * 踢出团对
 *
 * @param {any} query
 * @returns 踢出团对
 */
export const removeTeams = async (query: any) => {
    return await request({
        url: "/user/removeMember",
        method: "post",
        params: query,
    });
};

/**
 * 重制密码
 *
 * @param {any} query
 * @returns 重制密码
 */
export const resetPassword = async (query: any) => {
    return await request({
        url: "/user/resetPassword",
        method: "post",
        params: query,
    });
};

/**
 * 重制交易密码
 *
 * @param {any} query
 * @returns 重制交易密码
 */
export const resetBuyPassword = async (query: any) => {
    return await request({
        url: "/user/resetPayPassword",
        method: "post",
        params: query,
    });
};

/**
 * 新增用户
 *
 * @param {any} query
 * @returns 新增用户
 */
export const addUser = async (query: any) => {
    return await request({
        url: "/user/add",
        method: "post",
        params: query,
    });
};

/**
 * 获取会员等级(不分页)
 *
 * @param {any} query
 * @returns 获取会员等级(不分页)
 */
export const getUserLevelList = async (query: any) => {
    return await request({
        url: "/userLevel/getAll",
        method: "get",
        params: query,
    });
};

/**
 * 获取会员等级
 *
 * @param {any} query
 * @returns 获取会员等级
 */
export const editUserInfo = async (query: any) => {
    return await request({
        url: "/user/edit",
        method: "post",
        params: query,
    });
};

/**
 * 查看资金明细
 *
 * @param {any} query
 * @returns 查看资金明细
 */
export const getFundLog = async (query: any) => {
    return await request({
        url: "/fundLog/list",
        method: "get",
        params: query,
    });
};

/**
 * 获取账单流水
 *
 * @param {any} query
 * @returns 获取账单流水
 */
export const fundDetail = async (query: any) => {
    return await request({
        url: "/user/fundDetail",
        method: "post",
        params: query,
    });
};

/**
 * 账单流水导出
 *
 * @param {any} query
 * @returns 账单流水导出
 */
export const fundLogDownload = async (query: any) => {
    return await request({
        url: "/fundLog/export",
        method: "get",
        params: query,
    });
};

/**
 * 翻涌记录导出
 *
 * @param {any} query
 * @returns 翻涌记录导出
 */
export const rebateRecordDownload = async (query: any) => {
    return await request({
        url: "/user/agentList",
        method: "get",
        params: query,
    });
};

/**
 * 冻结余额
 *
 * @param {any} query
 * @returns 冻结余额
 */
export const frozenAmount = async (query: any) => {
    return await request({
        url: "/user/freezeUserMoney",
        method: "post",
        params: query,
    });
};

/**
 * 解冻冻结金额
 *
 * @param {any} query
 * @returns 解冻冻结金额
 */
export const relieveFreezeUserMoney = async (query: any) => {
    return await request({
        url: "/user/relieveFreezeUserMoney",
        method: "post",
        params: query,
    });
};

/**
 * 冻仓余额
 *
 * @param {any} query
 * @returns 冻仓余额
 */
export const limitMoney = async (query: any) => {
    return await request({
        url: "/user/limitMoney",
        method: "post",
        params: query,
    });
};

/**
 * 赠送彩金
 *
 * @param {any} query
 * @returns 赠送彩金
 */
export const userBonus = async (query: any) => {
    return await request({
        url: "/user/sendColourMoney",
        method: "post",
        params: query,
    });
};

/**
 * 增减积分
 *
 * @param {any} query
 * @returns 增减积分
 */
export const sendIntegral = async (query: any) => {
    return await request({
        url: "/user/sendIntegral",
        method: "post",
        params: query,
    });
};

/**
 * 新增/修改备注
 *
 * @param {any} query
 * @returns 新增/修改备注
 */
export const setRemark = async (query: any) => {
    return await request({
        url: "/user/updRemark",
        method: "post",
        params: query,
    });
};

/**
 * 修改用户等级
 *
 * @param {any} query
 * @returns 修改用户等级
 */
export const setRank = async (query: any) => {
    return await request({
        url: "/user/updUserLevel",
        method: "post",
        params: query,
    });
};

/**
 * 批量修改用户等级
 *
 * @param {any} query
 * @returns 批量修改用户等级
 */
export const batchUpdUserLevel = async (query: any) => {
    return await request({
        url: "/user/batchUpdUserLevel",
        method: "post",
        params: query,
    });
};

/**
 * 批量修改备注
 *
 * @param {any} query
 * @returns 批量修改备注
 */
export const batchUpdRemark = async (query: any) => {
    return await request({
        url: "/user/batchUpdRemark",
        method: "post",
        params: query,
    });
};

/**
 * 批量修改禁用-启用
 *
 * @param {any} query
 * @returns 批量修改禁用-启用
 */
export const batchUpdDisable = async (query: any) => {
    return await request({
        url: "/user/batchUpdDisable",
        method: "post",
        params: query,
    });
};

/**
 *
 *
 * @param {any} query
 * @returns
 */
export const batchUpdAgentLine = async (query: any) => {
    return await request({
        url: "/user/batchUpdAgentLine",
        method: "post",
        params: query,
    });
};

/**
 * 修改购买限制
 *
 * @param {any} query
 * @returns 修改购买限制
 */
export const setBuy = async (query: any) => {
    return await request({
        url: "/user/batchIsLimit",
        method: "post",
        params: query,
    });
};

// /**
//  * 用户列表导出
//  *
//  * @param {any} query
//  * @returns 用户列表导出
//  */
// export const getProxyList = async (query: any) => {
//     return await request({
//         url: "/user/agentList",
//         method: "get",
//         params: query,
//     });
// };
// // 用户列表导出
// export function userDownload(params: any) {
//     // return request.get({ url: '/rebateRecord/export',params })
//     return request.get(
//         { responseType: 'blob', url: '/user/export', params },
//         {
//             isTransformResponse: false
//         }
//     )
// }

/**
 * 编辑用户信息
 *
 * @param {any} query
 * @returns 编辑用户信息
 */
export const editRealUserName = async (query: any) => {
    return await request({
        url: "/user/editName",
        method: "post",
        params: query,
    });
};
